
<!doctype html>
<html lang="zh">
 
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Telegram Ai Bot 登录界面</title>
    <!-- Bootstrap CSS -->
    {include file="public/main_css" /}
    <style>
    html,
    body {
        height: 100%;
    }

    body {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-align: center;
        align-items: center;
        padding-top: 40px;
        padding-bottom: 40px;
    }
    </style>
</head>

<body>
    <!-- ============================================================== -->
    <!-- login page  -->
    <!-- ============================================================== -->
    <div class="splash-container">
        <div class="card ">
            <div class="card-header text-center"><span class="splash-description">请输入您的用户信息。</span></div>
            <div class="card-body">
                <form>
                    <div class="form-group">
                        <input class="form-control form-control-lg" id="username" type="text" placeholder="用户名" autocomplete="off">
                    </div>
                    <div class="form-group">
                        <input class="form-control form-control-lg" id="password" type="password" placeholder="密码">
                    </div>
                    <div class="form-group">
                        <label class="custom-control custom-checkbox">
                            <input class="custom-control-input" type="checkbox"><span class="custom-control-label">记住账号</span>
                        </label>
                    </div>
                </form>
                <button type="submit" onclick="dulogin()" class="btn btn-primary btn-lg btn-block">登录</button>
            </div>
            <div class="card-footer bg-white p-0  ">
                <div class="card-footer-item card-footer-item-bordered">
                    <a href="#" class="footer-link">创建一个帐户</a></div>
                <div class="card-footer-item card-footer-item-bordered">
                    <a href="#" class="footer-link">忘记密码</a>
                </div>
            </div>
        </div>
    </div>
  
    <!-- ============================================================== -->
    <!-- end login page  -->
    <!-- ============================================================== -->
    <!-- Optional JavaScript -->
    {include file="public/main_js" /}
    <script>
       function dulogin(){
           var username = $('#username').val();
           if(!username){msg('提示框','请输入您的用户名')}
           var password = $('#password').val();
           if(!password){msg('提示框','请输入您的登录密码')}
           
           $.post('/dulogin',{'username':username,'password':password},function(res){
               if(res.code>0){
                 msg('提示框',res.msg)  
               }else{
                 msg('提示框',res.msg)
                 setTimeout(function(){window.location.href="/index"},1000)
               }
           },'JSON');
       } 
    </script>
</body>
 
</html>